package org.jpro.common.http;

import org.jpro.exception.ExceptionCode;

import lombok.Getter;
import lombok.Setter;

/**
 * <P>功能描述 : 响应客户端标准格式 </P>
 * <P>File name : ResponseVO </P>
 * <P>Author : 王泽浩 </P>
 * <P>E-Mail : 1028625100@qq.com </P>
 * <P>Date : 2017/1/1 上午12:20</P>
 */
@Getter
@Setter
public class ResponseVO {

    /**
     * 状态码 @{@link org.jpro.exception.ExceptionCode }
     * 其余数值表示出现错误，该值对应ExceptionCode中定义的异常码
     */
    private int code;

    /**
     * 状态码提示
     */
    private String msg;

    /**
     * 数据信息
     */
    private Object data;

    public ResponseVO(ExceptionCode exceptionCode) {
        this.code = exceptionCode.getCode();
        this.msg = exceptionCode.getMsg();
    }

    public ResponseVO(ExceptionCode exceptionCode, Object data) {
        this.code = exceptionCode.getCode();
        this.msg = exceptionCode.getMsg();
        this.data = data;
    }

}
